{% extends 'VentureCustomerBundle::layout.html.twig' %}

{% block title %}Customer Listing{% endblock%}

{% block main %}
    {{ parent() }}
<div class="cont">
    <div> 
		<h2 class="heading">CUSTOMER</h2>
		
		<div>
            <button class="vendor_form_button" onclick="window.location='{{ path('venture_new_customer') }}'">Add new</button>
		</div>
		<br>
		<div class="listing-label">
            <p class="label">List of all active customers</p>                        
					{% if status %} 
					<p class="list-all">
						<input type = "checkbox" onchange="window.location='{{ path('venture_customer_list',  {'type': 'show_all'}) }}'"/> Show Inactive
					</p>
					{% else %}
					<p class="list-all">
						<input type = "checkbox" checked = "checked" onchange="window.location='{{ path('venture_customer_list',  {'type': 'show_active'}) }}'"/> Show Inactive
					</p>
					{% endif %}                       
        </div>		
   </div>
	<div class="clear"></div>
    <table id="hor-minimalist-a">
        <thead>
            <th>Customer Name</th>
            <th>Phone Number</th>
            <th>Email</th>
            <th>Contact</th>
        </thead>
        <tbody>
            {% for entity in entities %}
            <tr class="records {{ cycle(['odd', 'even'], loop.index0) }}">
                <td><a class="my_custom_anchor" href="{{ path('venture_customer_details',  {'id': entity.id}) }}">{{ entity.name }}</a></td>
                <td><a class="my_custom_anchor" href="{{ path('venture_customer_details',  {'id': entity.id}) }}">{{ entity.phoneNumber }}</a></td>
                <td><a class="my_custom_anchor" href="{{ path('venture_customer_details',  {'id': entity.id}) }}">{{ entity.contact1Email }}</a></td>
                <td><a class="my_custom_anchor" href="{{ path('venture_customer_details',  {'id': entity.id}) }}">{{ entity.contact1 }}</a></td>
            </tr>
            {% else %}
            <tr class="empty">
                <td colspan="5">There is no Customer listed yet</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
	</div>
{% endblock %}  


 